package org.dbpedia.lookup;

public class SearchSoapProxy implements org.dbpedia.lookup.SearchSoap {
  private String _endpoint = null;
  private org.dbpedia.lookup.SearchSoap searchSoap = null;
  
  public SearchSoapProxy() {
    _initSearchSoapProxy();
  }
  
  public SearchSoapProxy(String endpoint) {
    _endpoint = endpoint;
    _initSearchSoapProxy();
  }
  
  private void _initSearchSoapProxy() {
    try {
      searchSoap = (new org.dbpedia.lookup.SearchLocator()).getsearchSoap();
      if (searchSoap != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)searchSoap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)searchSoap)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (searchSoap != null)
      ((javax.xml.rpc.Stub)searchSoap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public org.dbpedia.lookup.SearchSoap getSearchSoap() {
    if (searchSoap == null)
      _initSearchSoapProxy();
    return searchSoap;
  }
  
  public org.dbpedia.lookup.Result[] prefixSearch(java.lang.String queryString, java.lang.String queryClass, java.lang.String maxHits) throws java.rmi.RemoteException{
    if (searchSoap == null)
      _initSearchSoapProxy();
    return searchSoap.prefixSearch(queryString, queryClass, maxHits);
  }
  
  public org.dbpedia.lookup.Result[] keywordSearch(java.lang.String queryString, java.lang.String queryClass, java.lang.String maxHits) throws java.rmi.RemoteException{
    if (searchSoap == null)
      _initSearchSoapProxy();
    return searchSoap.keywordSearch(queryString, queryClass, maxHits);
  }
  
  
}